<!--
 * @Author: your name
 * @Date: 2022-03-31 09:19:22
 * @LastEditTime: 2022-03-31 09:20:46
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \geyao\geyao\模板方法模式220331.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>模板方法定义</title>
</head>

<body>
  <script>
    // 代码初始化

    Interview.prototype.init = function () {

      this.writtenTest();

      this.technicalInterview();

      this.leader();

      this.waitNotice();

    };
    var BaiDuInterview = function () {};

    BaiDuInterview.prototype = new Interview();



    // 子类重写方法 实现自己的业务逻辑

    BaiDuInterview.prototype.writtenTest = function () {

      console.log("我终于看到百度的笔试题了");

    }

    BaiDuInterview.prototype.technicalInterview = function () {

      console.log("我是百度的技术负责人，想面试找我");

    }

    BaiDuInterview.prototype.leader = function () {

      console.log("我是百度的leader，不想加班的或者业绩提不上去的给我滚蛋");

    }

    BaiDuInterview.prototype.waitNotice = function () {

      console.log("百度的人力资源太不给力了，我等的花儿都谢了！！");

    }

    var baiDuInterview = new BaiDuInterview();

    baiDuInterview.init();
  </script>
</body>

</html>